#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>

using namespace std;

int mod = 1e9 + 7;

int countHomogenous(string s) {
    long long res = 0;
    int cnt = 0;
    char c = s[0];
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == c)   cnt++;
        else
        {
            res += (long long)(cnt + 1) * cnt / 2;
            cnt = 1;
            c = s[i];
        }
    }
    res += (long long)(cnt + 1) * cnt / 2;
    return res % mod;
}

int main()
{
    string s = "xy";
    cout << countHomogenous(s);
    return 0;
}